package com.order.server.controller;

import com.order.server.model.OrderInfo;
import com.order.server.service.OrderService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService ;

    // 根据 url来获取参数
    @RequestMapping("/{orderId}")
    public OrderInfo getProductInfo(@PathVariable("orderId") Integer orderId){
        return orderService .selectOrderById(orderId);
    }
}
